﻿using System.Drawing;

public class LuaCodeWriter : BaseCodeWriter
{
    public LuaCodeWriter(Action<string> writer) : base(writer) { }
    protected override string TOKEN_INDENT { get; } = "    ";
    protected override string TOKEN_COMMENT { get; } = "--";
    protected override string TOKEN_BEGIN_COMMENT_MUT { get; } = "--[[";
    protected override string TOKEN_END_COMMENT_MUT { get; } = "--]]";
}

public class LuaCodeConsole : LuaCodeWriter
{
    private readonly Stack<ConsoleColor> _colors;
    public LuaCodeConsole()
        : base(Console.Out.Write)
    {
        _colors = new Stack<ConsoleColor>();
    }
    public override void PushColor(ConsoleColor color)
    {
        _colors.Push(Console.ForegroundColor);
        Console.ForegroundColor = color;
    }
    public override void PopColor()
    {
        Console.ForegroundColor = _colors.Pop();
    }
}